#ifndef __JSON_UTIL_H__
#define __JSON_UTIL_H__
//实现一些简易化接口

#include <string>
#include <stdint.h>
#include "json.h"

namespace Json{


bool Json2Value(const Value& value, char& out);

bool Json2Value(const Value& value, uint8_t& out);

bool Json2Value(const Value& value, short& out);

bool Json2Value(const Value& value, uint16_t& out);

bool Json2Value(const Value& value, int& out);

bool Json2Value(const Value& value, uint32_t& out);

bool Json2Value(const Value& value, int64_t& out);

bool Json2Value(const Value& value, uint64_t& out);

bool Json2Value(const Value& value, bool& out);

bool Json2Value(const Value& value, float& out);

bool Json2Value(const Value& value, double& out);

bool Json2Value(const Value& value, std::string& out);


bool getJsonByKey(const Value& value, const std::string &key, char& out);

bool getJsonByKey(const Value& value, const std::string &key, uint8_t& out);

bool getJsonByKey(const Value& value, const std::string &key, short& out);

bool getJsonByKey(const Value& value, const std::string &key, uint16_t& out);

bool getJsonByKey(const Value& value, const std::string &key, int& out);

bool getJsonByKey(const Value& value, const std::string &key, uint32_t& out);

bool getJsonByKey(const Value& value, const std::string &key, bool& out);

bool getJsonByKey(const Value& value, const std::string &key, float& out);

bool getJsonByKey(const Value& value, const std::string &key, double& out);

bool getJsonByKey(const Value& value, const std::string &key, std::string& out);

bool getJsonByKey(const Value& value, const std::string &key, Value& out);


bool getJsonChar(const Value& value, const std::string &key, char& out);

bool getJsonUint8(const Value& value, const std::string &key, uint8_t& out);

bool getJsonShort(const Value& value, const std::string &key, short& out);

bool getJsonUint16(const Value& value, const std::string &key, uint16_t& out);

bool getJsonInt(const Value& value, const std::string &key, int& out);

bool getJsonUInt(const Value& value, const std::string &key, uint32_t& out);

bool getJsonInt64(const Value& value, const std::string &key, int64_t& out);

bool getJsonUInt64(const Value& value, const std::string &key, uint64_t& out);

bool getJsonBool(const Value& value, const std::string &key, bool& out);

bool getJsonFloat(const Value& value, const std::string &key, float& out);

bool getJsonDouble(const Value& value, const std::string &key, double& out);

bool getJsonString(const Value& value, const std::string &key, std::string& out);

bool getJsonValue(const Value& value, const std::string &key, Value& out);

bool isJsonBoolArray(const Value& value);

bool isJsonBoolArray(const Value& value, const std::string &key);

bool isJsonIntArray(const Value& value);

bool isJsonIntArray(const Value& value, const std::string &key);

bool isJsonUIntArray(const Value& value);

bool isJsonUIntArray(const Value& value, const std::string &key);

bool isJsonDoubleArray(const Value& value);

bool isJsonDoubleArray(const Value& value, const std::string &key);

bool isJsonStringArray(const Value& value);

bool isJsonStringArray(const Value& value, const std::string &key);



}

#endif
